package com.lzhsite.technology.designPattern.strategy.GuessDemo;

import java.util.Random;

public class FirstType implements IGuessType {
	private Random random;
	private boolean win = false;
	private Hand preHand;

	public FirstType(int seed) {
		random = new Random(seed);
	}

	public Hand nextHand() {
		if (!win) {
			//生成一个随机的int值,该值介于[0,3)的区间
			preHand = Hand.getHand(random.nextInt(3));
		}
		return preHand;
	}

	public void whetherWin(boolean win) {
		this.win = win;
	}
}
